package cn.iocoder.yudao.module.member.controller.app.banner;

import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.module.member.controller.admin.banner.vo.BannerPageReqVO;
import cn.iocoder.yudao.module.member.controller.admin.banner.vo.BannerRespVO;
import cn.iocoder.yudao.module.member.controller.admin.banner.vo.BannerSaveReqVO;
import cn.iocoder.yudao.module.member.dal.dataobject.banner.BannerDO;
import cn.iocoder.yudao.module.member.service.banner.BannerService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException;
import java.util.List;

import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

@Tag(name = "用户app - banner图管理")
@RestController
@RequestMapping("/member/banner")
@Validated
public class AppBannerController {

    @Resource
    private BannerService bannerService;


    @GetMapping("/list")
    @Operation(summary = "获得banner图管理分页")
    public CommonResult<List<BannerRespVO>> getBannerList() {
        List<BannerDO> pageResult = bannerService.getBannerList();
        return success(BeanUtils.toBean(pageResult, BannerRespVO.class));
    }
}